home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SimpliFace.h
-
- Contains: Interface for a simple Scriptable application.
-
- Developed by:
-
- Paul G Smith (commstalk hq & Full Moon Software, Inc)
-
- you can leave messages at (UK): 0727 844232; (US): 408 253 7199
- BUT I prefer to be contacted by e-mail
- AppleLink: SMITH.PG
- Internet: SMITH.PG@applelink.apple.com
-
- "SimpliFace" Sample code to accompany develop article
- on techniques for embedding scripts in applications.
-
- */
-
- #ifndef __SIMPLIFACE__
- #define __SIMPLIFACE__
-
- #ifndef __APPLICATION__
- #include <Application.h>
- #endif
-
- #ifndef __PASCALSTRING__
- #include "PascalString.h"
- #endif
-
- #ifndef __LISTOFLONGS__
- #include "ListOfLongs.h"
- #endif
-
- /**********************************************************************
- ** class TSimpliFace
- ***********************************************************************/
-
- class TSimpliFace : public TApplication {
- public:
- TSimpliFace(Ptr qdPtr);
- virtual ~TSimpliFace();
-
- virtual void DoIdle();
- virtual void AdjustMenus();
- virtual void AdjustCursor();
- virtual void DoMenuCommand(short menuID, short menuItem);
- virtual void Terminate();
-
- virtual void DoActivateEvt();
- virtual void DoUpdateEvt();
- virtual void DoGoAway();
-
- virtual void GetThisAppName(CStr255& appName);
-
- virtual Boolean HandleContentClick (AEDesc *target,
- WindowPtr tWind, EventRecord& theEvent);
- virtual Boolean HandleGoAway (AEDesc *target,
- WindowPtr tWind);
- virtual Boolean HandleMenuCommand (AEDesc *target,
- short menuNum, short itemNum);
- virtual Boolean HandleMouseDown (AEDesc *target,
- EventRecord& theEvent);
- virtual Boolean HandleKeyDown (AEDesc *target,
- EventRecord& theEvent);
- virtual Boolean HandleEvent (EventRecord& theEvent, Boolean& pass);
- // returns true if event was handled by aevt pre-handler
-
- virtual OSErr CollectAETEs(short languageCode, AEDesc& resultDesc);
-
- virtual void SetUp(); // Run before event loop starts
- virtual void CleanUp(); // run at end of loop
-
- // Returns total stack space required in bytes.
- virtual long StackNeeded();
-
- // Returns total heap space required in bytes.
- virtual long HeapNeeded();
-
- virtual unsigned long SleepVal(); // how long to sleep in WaitNextEvent
-
- // AE object model support
-
- virtual OSErr CountElements (DescType desiredClass,
- long *result);
-
- virtual OSErr ResolveContainer (TScriptableObject **theContainerObj);
-
- virtual OSErr ResolveElementByName(DescType desiredClass,
- CStr255& nameStr,
- TScriptableObject **theResultObj);
-
- virtual OSErr ResolveElementByIndex(DescType desiredClass,
- short theIndex,
- TScriptableObject **theResultObj);
-
- virtual OSErr GetProperty (DescType propertyID, DescType wantType, AEDesc *result);
-
- virtual OSErr SetProperty (DescType propertyID, const AEDesc *theData);
-
- virtual OSErr CreateNewElement (DescType desiredClass,
- DescType position,
- AEDesc *theData,
- AERecord *theProperties,
- TScriptableObject *theContainerObj,
- TScriptableObject **theNewObj);
-
-
- virtual OSErr GetTargetObjectSpecifier (EventRecord& theEvent, AEDesc *result);
-
- private:
- TListOfLongs fWindowObjects;
- };
-
- /* -----------------------------------------------------------------
- inline methods
- ----------------------------------------------------------------- */
-
-
- extern TSimpliFace* gSimpliFace;
-
-
- #endif
-